package com.shop.service;

import com.shop.entity.SysUser;
import com.shop.entity.dto.RolePerssionDTO;
import com.shop.utils.ResultUtils;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserService {

    /**
     * 查询所有用户
     * @return List<SysUser>
     */
    List<SysUser> findAllSysUser();

    /**
     *
     * @param sysUser
     * @return Integer
     */
    ResultUtils updateSysUser(SysUser sysUser,List<Integer> roleId);

    /**
     * 根据用户名查询密码
     * @param userName
     * @return  SysUser
     */
    SysUser findSysUserByUserName( String userName);

    /**
     * 用户认证授权登录
     * @param user
     * @return
     */
    ResultUtils login(SysUser user);

    /**
     * 查询角色和权限数据
     * @param userName
     * @return List<RolePerssionDTO>
     */
    List<RolePerssionDTO> findRolePerssionByUserName(String userName);

    /**
     *查询用户数据
     * @param userName
     * @return ResultUtils
     */
    ResultUtils findUserRoleByNameData(String userName,Integer current,Integer size);

    /**
     * 更具id删除用户
     * @param id
     * @return
     */
    ResultUtils deleteSysUserById(Integer id);

    ResultUtils  saveSysUser(SysUser sysUser,Integer roleId);

}
